package com.itheima.tcp;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {

    public static void main(String[] args) throws IOException {
        //1.创建发送端对象
        Socket cs = new Socket("127.0.0.1",8888);
        //组织数据
        String s="你好啊";
        byte[] bytes = s.getBytes();
        //发送
        OutputStream os = cs.getOutputStream();
        os.write(bytes);
        //释放资源
        os.close();
        cs.close();

    }
}
